package at.fhooe.engine.event.events;

import at.fhooe.engine.event.EventListener;

public class EntityMovedEvent extends Event {

	public static final String TYPE = "EntityMoved";
	
	private String m_entityName;
	private double m_newPositionX;
	private double m_newPositionY;
	private double m_newRotationAngle;
	
	public EntityMovedEvent(String entityName, double newPositionX, double newPositionY, double newRotationAngle) {
		super(TYPE);
		
		m_entityName = entityName;
		m_newPositionX = newPositionX;
		m_newPositionY = newPositionY;
		m_newRotationAngle = newRotationAngle;
	}
	
	public String getEntityName() {
		return m_entityName;
	}
	public double getNewPositionX() {
		return m_newPositionX;
	}
	public double getNewPositionY() {
		return m_newPositionY;
	}
	public double getNewRotationAngle() {
		return m_newRotationAngle;
	}
	
	public void processEvent(EventListener eventListener) {
		((Listener) eventListener).onEntityMovedEvent(this);		
	}
	
	//embedded listener interface with the specific function call
	public interface Listener extends EventListener {
		public void onEntityMovedEvent(EntityMovedEvent entityMovedEvent);
	}

}
